package com.dmcb.trade.business.services;

import com.dmcb.common.business.services.BaseService;
import com.dmcb.common.business.utils.DateUtil;
import com.dmcb.common.web.conversion.JsonResult;
import com.dmcb.trade.business.constants.CrawlConstant;
import com.dmcb.trade.business.crawlers.article.*;
import com.dmcb.trade.business.crawlers.author.*;
import com.dmcb.trade.business.entities.Article;
import com.dmcb.trade.business.entities.Author;
import com.dmcb.trade.business.entities.AuthorLink;
import com.dmcb.trade.business.mappers.ArticleCrawlMapper;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.nodes.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 文章爬取服务
 * Created by long on 2016/3/25
 */
@Service
public class ArticleCrawlerService extends BaseService {
    Logger logger = LoggerFactory.getLogger(ArticleCrawlerService.class);

    @Autowired
    private ToutiaoCrawler toutiaoCrawler;
    @Autowired
    private SohuCrawler sohuCrawler;
    @Autowired
    private JianshuCrawler jianshuCrawler;
    @Autowired
    private BaijiaCrawler baijiaCrawler;
    @Autowired
    private KuaiBaoCrawler kuaiBaoCrawler;
    @Autowired
    private ShiGuangWangCrawler shiGuangWangCrawler;
    @Autowired
    private ZhiHuCrawler zhiHuCrawler;
    @Autowired
    private ChuanSongMenCrawler chuanSongMenCrawler;
    @Autowired
    private FuWuHuiCrawler fuWuHuiCrawler;
    @Autowired
    private PinTuCrawler pinTuCrawler;
    @Autowired
    private ChuangZhiCrawler chuangZhiCrawler;
    @Autowired
    private QuanJiHangMuCrawler quanJiHangMuCrawler;
    @Autowired
    private JiKeGongYuanCrawler jiKeGongYuanCrawler;
    @Autowired
    private BoWangZhiCrawler boWangZhiCrawler;
    @Autowired
    private QianBaoCrawler qianBaoCrawler;
    @Autowired
    private QianBiDaoCrawler qianBiDaoCrawler;
    @Autowired
    private TouZiSheQuCrawler touZiSheQuCrawler;

    @Autowired
    private ArticleCrawlMapper articleCrawlMapper;

    @Autowired
    private XiNiuGuShiCrawler xiNiuGuShiCrawler;

    @Autowired
    private XinLangBoKeCrawler xinLangBoKeCrawler;

    @Autowired
    private DouBanCommentCrawler douBanCommentCrawler;

    @Autowired
    private DouBanNoteCrawler douBanNoteCrawler;
    @Autowired
    private ZheJiang24HourCrawler zheJiang24HourCrawler;
    @Autowired
    private BaiJiaHaoCrawler baiJiaHaoCrawler;


    public Map<Integer, BaseCrawler> crawlerMap;

    @Autowired
    private SohuParser sohuParser;
    @Autowired
    private LifeTimesParser lifeTimesParser;
    @Autowired
    private JianshuParser jianshuParser;
    @Autowired
    private ToutiaoParser toutiaoParser;
    @Autowired
    private WeixinParser weixinParser;
    @Autowired
    private WangyiParser wangyiParser;
    @Autowired
    private XinLangParser xinLangParser;
    @Autowired
    private FengHuangParser fengHuangParser;
    @Autowired
    private TengXunParser tengXunParser;
    @Autowired
    private XinHuaParser xinHuaParser;
    @Autowired
    private YangShiParser yangShiParser;
    @Autowired
    private HuanQiuParser huanQiuParser;
    @Autowired
    private CanKaoXiaoXiParser canKaoXiaoXiParser;
    @Autowired
    private RenMinParser renMinParser;
    @Autowired
    private ZhongGuoZhengFuParser zhongGuoZhengFuParser;
    @Autowired
    private DaGongParser daGongParser;
    @Autowired
    private ZhongGuoQingNianParser zhongGuoQingNianParser;
    @Autowired
    private YangGuangParser yangGuangParser;
    @Autowired
    private GuoJiZaiXianParser guoJiZaiXianParser;
    @Autowired
    private XingDaoHuanQiuParser xingDaoHuanQiuParser;
    @Autowired
    private DongFangParser dongFangParser;
    @Autowired
    private AnQingXinWenParser anQingXinWenParser;
    @Autowired
    private AnHuiParser anHuiParser;
    @Autowired
    private ZongYangZaiXianParser zongYangZaiXianParser;
    @Autowired
    private HuaXiaShiBaoParser huaXiaShiBaoParser;
    @Autowired
    private QianLongXinWenParser qianLongXinWenParser;
    @Autowired
    private XinJingBaoParser xinJingBaoParser;
    @Autowired
    private TianJingWangParser tianJingWangParser;
    @Autowired
    private ChongQingWanBaoParser chongQingWanBaoParser;
    @Autowired
    private DongNanParser dongNanParser;
    @Autowired
    private MeiZhouWangParser meiZhouWangParser;
    @Autowired
    private GuangXiXinWenParser guangXiXinWenParser;
    @Autowired
    private GuiZhouDuShiBaoParser guiZhouDuShiBaoParser;
    @Autowired
    private QiLuWanBaoParser qiLuWanBaoParser;
    @Autowired
    private HeBeiQingNianBaoParser heBeiQingNianBaoParser;
    @Autowired
    private ShiJiaZhuangXinWenParser shiJiaZhuangXinWenParser;
    @Autowired
    private HanDanXinWenParser hanDanXinWenParser;
    @Autowired
    private HeBeiXinWenParser heBeiXinWenParser;
    @Autowired
    private DongFangJinBaoParser dongFangJinBaoParser;
    @Autowired
    private LuoHeWangParser luoHeWangParser;
    @Autowired
    private ZhuMaDianXinWenParser zhuMaDianXinWenParser;
    @Autowired
    private DaHeWangParser daHeWangParser;
    @Autowired
    private JieMianParser jieMianParser;
    @Autowired
    private DuJiaParser duJiaParser;
    @Autowired
    private TaiMeiTiParser taiMeiTiParser;
    @Autowired
    private KanChaiWangParser kanChaiWangParser;
    @Autowired
    private KeParser keParser;
    @Autowired
    private TouZiJieParser touZiJieParser;
    @Autowired
    private HuXiuParser huXiuParser;
    @Autowired
    private AiRuiParser aiRuiParser;
    @Autowired
    private YiXinLiParser yiXinLiParser;
    @Autowired
    private TopYSParser topYSParser;
    @Autowired
    private RRDSCPJLParser rrdscpjlParser;
    @Autowired
    private AdminParser adminParser;
    @Autowired
    private GuoKeParser guoKeParser;
    @Autowired
    private ZGShiGeParser zgShiGeParser;
    @Autowired
    private ShuLaQuanParser shuLaQuanParser;
    @Autowired
    private UEZongZuoBiaoParser ueZongZuoBiaoParser;
    @Autowired
    private PinWanParser pinWanParser;
    @Autowired
    private JinRongJieParser jinRongJieParser;
    @Autowired
    private NanFangZhouMoParser nanFangZhouMoParser;
    @Autowired
    private MeiJingWangParser meiJingWangParser;
    @Autowired
    private XLiShiParser xLiShiParser;
    @Autowired
    private GQParser gqParser;
    @Autowired
    private HanXingParser hanXingParser;
    @Autowired
    private NanDuYuLeParser nanDuYuLeParser;
    @Autowired
    private ZiMeiParser ziMeiParser;
    @Autowired
    private JingHuaShiBaoParser jingHuaShiBaoParser;
    /* @Autowired
     private WeiKouWangParser weiKouWangParser;*/
    @Autowired
    private ZGQiYeJiaParser zgQiYeJiaParser;
    @Autowired
    private JinYangFoodParser jinYangFoodParser;
    @Autowired
    private GongShiParser gongShiParser;
    @Autowired
    private ChuangYeBangParser chuangYeBangParser;
    @Autowired
    private ZGJingYingParser zgJingYingParser;
    @Autowired
    private ShangXueYuanParser shangXueYuanParser;
    @Autowired
    private ZhiChangParser zhiChangParser;
    @Autowired
    private YiBangParser yiBangParser;
    @Autowired
    private TuiKuParser tuiKuParser;
    @Autowired
    private YueLvXingParser yueLvXingParser;
    @Autowired
    private ChuanSongMenParser chuanSongMenParser;
    @Autowired
    private TuoPuRiBaoParser tuoPuRiBaoParser;
    @Autowired
    private ShengHuoZhiParser shengHuoZhiParser;
    @Autowired
    private WenYiShengHuoParser wenYiShengHuoParser;
    @Autowired
    private XinLangBoKeParser xinLangBoKeParser;
    @Autowired
    private ZhongXiRuanParser zhongXiRuanParser;
    @Autowired
    private ZGHYXXWParser zghyxxwParser;
    @Autowired
    private SWFWWParser swfwwParser;
    @Autowired
    private ShangLuTongParser shangLuTongParser;
    @Autowired
    private SouLeParser souLeParser;
    @Autowired
    private HFIPLAWParser hfiplawParser;
    @Autowired
    private ZhongHuaQuMingWangParser zhongHuaQuMingWangParser;
    @Autowired
    private FaBangWangParser faBangWangParser;
    @Autowired
    private ShangBiaoParser shangBiaoParser;
    @Autowired
    private YiZhanYueDuParser yiZhanYueDuParser;
    @Autowired
    private NaJiaoLuoParser naJiaoLuoParser;
    @Autowired
    private BeiJingLianMengParser beiJingLianMengParser;
    @Autowired
    private KuFanParser kuFanParser;
    @Autowired
    private LunWenWangParser lunWenWangParser;
    @Autowired
    private GeRenTuShuGuanParser geRenTuShuGuanParser;
    @Autowired
    private NiuBBParser niuBBParser;
    @Autowired
    private NiuGeWangParser niuGeWangParser;
    @Autowired
    private TZTTParser tzttParser;
    @Autowired
    private QKZZParser qkzzParser;
    @Autowired
    private LiuXingSheParser liuXingSheParser;
    @Autowired
    private JianBiHuaParser jianBiHuaParser;
    @Autowired
    private YCWBParser ycwbParser;
    @Autowired
    private JinYangKeJiParser jinYangKeJiParser;
    @Autowired
    private JinYangQiCheParser jinYangQiCheParsers;
    @Autowired
    private JinYangJianKangParser jinYangJianKangParser;
    @Autowired
    private JinYangLifeParser jinYangLifeParser;
    @Autowired
    private JinYangCutureParser jinYangCutureParser;
    @Autowired
    private JinYangMoneyParser jinYangMoneyParser;
    @Autowired
    private JinYangEduParser jinYangEduParser;
    @Autowired
    private JinYangParser jinYangParser;
    @Autowired
    private ZuoJiaParser zuoJiaParser;
    @Autowired
    private AiNiWeiParser aiNiWeiParser;
    @Autowired
    private YuLuWenZhangParser yuLuWenZhangParser;
    @Autowired
    private YuWenMiParser yuWenMiParser;
    @Autowired
    private XueParser xueParser;
    @Autowired
    private FengShangParser fengShangParser;
    @Autowired
    private KuKuWangParser kuKuWangParser;
    @Autowired
    private SanLianParser sanLianParser;
    @Autowired
    private QuanQuanWangParser quanQuanWangParser;
    @Autowired
    private JiuAiYueDuParser jiuAiYueDuParser;
    @Autowired
    private JiFengParser jiFengParser;
    @Autowired
    private XueYouParser xueYouParser;
    @Autowired
    private BaiDuWenKuParser baiDuWenKuParser;
    @Autowired
    private SanYiWenKuParser sanYiWenKuParser;
    @Autowired
    private AsiaLuoSiParser asiaLuoSiParser;
    @Autowired
    private DaXueShengZaiXianParser daXueShengZaiXianParser;
    @Autowired
    private KaoShiBaParser kaoShiBaParser;
    @Autowired
    private YanCaoChinaParser yanCaoChinaParser;
    @Autowired
    private KJSONParser kjsonParser;
    @Autowired
    private GuiYangParser guiYangParser;
    @Autowired
    private XuZhouZaiXianParser xuZhouZaiXianParser;
    @Autowired
    private DaoZhouParser daoZhouParser;
    @Autowired
    private NanYangShiParser nanYangShiParser;
    @Autowired
    private ZiXueParser ziXueParser;
    @Autowired
    private Xuan6Parser xuan6Parser;
    @Autowired
    private JiaZhangBangParser jiaZhangBangParser;
    @Autowired
    private QinQinBaoBeiParser qinQinBaoBeiParser;
    @Autowired
    private BeiFangParser beiFangParser;
    @Autowired
    private PaoPaoParser paoPaoParser;
    @Autowired
    private DouBanParser douBanParser;
    @Autowired
    private AiWeiBangParser aiWeiBangParser;
    @Autowired
    private KaoDianErParser kaoDianErParser;
    @Autowired
    private DiYiWangDaiParser diYiWangDaiParser;
    @Autowired
    private HeXunParser heXunParser;
    @Autowired
    private RGZNZWZXPTParser rgznzwzxptParser;
    @Autowired
    private ZhanZhangZhiJIiaParser zhanzhangzhijia;
    @Autowired
    private QingWangParser qingWangParser;
    @Autowired
    private HuiBoZiXunParser huiBoZiXunParser;
    @Autowired
    private TianYaParser tianYaParser;
    @Autowired
    private TongXinShiJieParser tongXinShiJieParser;
    @Autowired
    private BeiJingCanKaoParser beiJingCanKaoParser;
    @Autowired
    private JianKangShengHuoParser jianKangShengHuoParser;
    @Autowired
    private YuErParser yuErParser;
    @Autowired
    private HuHuParser huHuParser;
    @Autowired
    private WanHuaJingParser wanHuaJingParser;
    @Autowired
    private JinTianXinWenParser jinTianXinWenParser;
    @Autowired
    private BeiErQinParser beiErQinParser;
    @Autowired
    private TongLiangShiChuangParser tongLiangShiChuangParser;
    @Autowired
    private PinTuParser pinTuParser;
    @Autowired
    private ZGDZSWYJParer zgdzswyjParers;
    @Autowired
    private YueDuParser yueDuParser;
    @Autowired
    private KaiXinParser kaiXinParser;
    @Autowired
    private WeiTouTiaoParser weiTouTiaoParser;
    @Autowired
    private HaoKuParser haoKuParser;
    @Autowired
    private SanWenParser sanWenParser;
    @Autowired
    private BaiDuBaiJiaParser baiDuBaiJiaParser;
    @Autowired
    private YiDianZiXunParser yiDianZiXunParser;
    @Autowired
    private FenSiParser fenSiParser;
    @Autowired
    private GuoKuParser guoKuParser;
    @Autowired
    private HuaZhiRenCaiParser huaZhiRenCaiParser;
    @Autowired
    private ShangYouQuanParser shangYouQuanParser;
    @Autowired
    private ZGGXXLZXParser zggxxlzxParser;
    @Autowired
    private WenKangParser wenKangParser;
    @Autowired
    private HBYuanChengParser hbYuanChengParser;
    @Autowired
    private YiMiYangGuangParser yiMiYangGuangParser;
    @Autowired
    private JingDianSanWenParser jingDianSanWenParser;
    @Autowired
    private RenShengZhiNanParser renShengZhiNanParsers;
    @Autowired
    private CN21Parser cn21Parser;
    @Autowired
    private WeiShiDaiParser weiShiDaiParser;
    @Autowired
    private BeiJingWanBaoParser beiJingWanBaoParser;
    @Autowired
    private ZhiBeiJiaoYuParser zhiBeiJiaoYuParser;
    @Autowired
    private BiYouParser biYouParser;
    @Autowired
    private LeDuParser leDuParser;
    @Autowired
    private ZhongGuoYuLeParser zhongGuoYuLeParser;
    @Autowired
    private DaZuiBaBaParser daZuiBaBaParser;
    @Autowired
    private ZhangZiShiParser zhangZiShiParser;
    @Autowired
    private XinLanParser xinLanParser;
    @Autowired
    private MeiTanParser meiTanParser;
    @Autowired
    private JiMoXinXiGangParser jiMoXinXiGangParser;
    @Autowired
    private GuangMingParser guangMingParser;
    @Autowired
    private AoYiParser aoYiParser;
    @Autowired
    private ChangJiangParser changJiangParser;
    @Autowired
    private LanJingParser lanJingParser;
    @Autowired
    private JiaSuHuiParser jiaSuHuiParser;
    @Autowired
    private PianKeParser pianKeParser;
    @Autowired
    private XiNiuGuShiParser xiNiuGuShiParser;
    @Autowired
    private MaFengWoParser maFengWoParser;
    @Autowired
    private ZOLParser zolParser;
    @Autowired
    private SanMaoParser sanMaoParser;
    @Autowired
    private ChangJiangRiBaoParser changJiangRiBaoParser;
    @Autowired
    private DouBanMMParser douBanMMParser;
    @Autowired
    private JingDianParser jingDianParser;
    @Autowired
    private ShiGuangWangParser shiGuangWangParser;
    @Autowired
    private KaiDiSheQuParser kaiDiSheQuParser;
    @Autowired
    private BoAoParser boAoParser;
    @Autowired
    private JinJiangParser jinjiangParser;
    @Autowired
    private QianJiangParser qianJiangParser;
    @Autowired
    private ZhihuParser zhihuParser;
    @Autowired
    private FuWuHuiParser fuWuHuiParser;
    @Autowired
    private PengPaiParser pengPaiParser;
    @Autowired
    private XueQiuParser xueQiuParser;
    @Autowired
    private WaCaiParser waCaiParser;
    @Autowired
    private LieYunParser lieYunParser;
    @Autowired
    private SouGouWeiXinParser souGouWeiXinParser;
    @Autowired
    private TuoNiaoParser tuoNiaoParser;
    @Autowired
    private KuaiBaoParser kuaiBaoParser;
    @Autowired
    private ZheJiangRiBaoParser zheJiangRiBaoParser;

    @Autowired
    private GongChanDangYuanParser gongChanDangYuanParser;
    @Autowired
    private ZheJiangFaZhiBaoParser zheJiangFaZhiBaoParser;
    @Autowired
    private JiangNanYouBaoParser jiangNanYouBaoParser;
    @Autowired
    private HaiNingRiBaoParser haiNingRiBaoParser;
    @Autowired
    private DongYangRiBaoParser dongYangRiBaoParser;
    @Autowired
    private WenLingRiBaoParser wenLingRiBaoParser;
    @Autowired
    private MeiShuBaoParser meiShuBaoParser;
    @Autowired
    private ZheJiangLaoNianBaoParser zheJiangLaoNianBaoParser;
    @Autowired
    private KeQiaoRiBaoParser keQiaoRiBaoParser;
    @Autowired
    private ChuangZhiParser chuangZhiParser;
    @Autowired
    private QuanJiHangMuParser quanJiHangMuParser;
    @Autowired
    private JiKeGongYuanParser jiKeGongYuanParser;
    @Autowired
    private BoWangZhiParser boWangZhiParser;
    @Autowired
    private QianBaoParser qianBaoParser;
    @Autowired
    private PencilNewsParser pencilNewsParser;
    @Autowired
    private ZheJiang24HourParser zheJiang24HourParser;
    @Autowired
    private BaiJiaHaoParser baiJiaHaoParser;
    @Autowired
    private JianKangShiBaoParser jianKangShiBaoParser;
    @Autowired
    private TeMaiParser teMaiParser;
    @Autowired
    private WaiTanParser waiTanParser;
    @Autowired
    private KuaiWanSiWeiParser kuaiWanSiWeiParser;
    @Autowired
    private LuoYangParser luoYangParser;
    @Autowired
    private UCTouTiaoParser ucTouTiaoParser;
    @Autowired
    private SSPaiParser ssPaiParser;
    @Autowired
    private ChaoQiParser chaoQiParser;
    @Autowired
    private BeiJingShiJianParser beiJingShiJianParser;
    @Autowired
    private UCTouTiaoMobileParser ucTouTiaoMobileParser;
    @Autowired
    private LeJuParser leJuParser;
    @Autowired
    private ZhiYinParser zhiYinParser;
    @Autowired
    private AiFanErParser aiFanErParser;
    @Autowired
    private YouDiaoParser youDiaoParser;

    @Autowired
    private BaiJiaHao2Parser baiJiaHao2Parser;
    @Autowired
    private HiNaBianParser hiNaBianParser;
    @Autowired
    private TouZiSheQuParser touZiSheQuParser;
    @Autowired
    private KuaiZiXunParser kuaiZiXunParse;
    @Autowired
    private JinRiXinXianShiParser jinRiXinXianShiPaser;
    @Autowired
    private DanDanZanParser danDanZanParser;
    @Autowired
    private PinLueWangParser pinLueWangParser;
    @Autowired
    private YuLeZiXunWangParser yuLeZiXunWangParser;
    @Autowired
    private ZhenGeXueWangParser zhenGeXueWangParser;
    @Autowired
    private QiHuParser qiHuParser;
    @Autowired
    private HuaQiWangParser huaQiWangParser;
    @Autowired
    private ShaoYangFCParser shaoYangFCParser;
    @Autowired
    private ZhuQiuZhiBoParser zhuQiuZhiBoParser;
    @Autowired
    private BaiJiaZaPingParser baiJiaZaPingParser;
    @Autowired
    private TSZLaoWuParser tszLaoWuParser;
    @Autowired
    private TianChengYiLiaoParser tianChengYiLiaoParser;
    @Autowired
    private BitCoinParser bitCoinParser;
    @Autowired
    private TianKongTalkParser tianKongTalkParser;
    @Autowired
    private ZhongYuanParser zhongYuanParser;
    @Autowired
    private BanBanParser banBanParser;
    @Autowired
    private LaTiaoZiXunParser laTiaoZiXunParser;
    @Autowired
    private JianKangTouTiaoParser jianKangTouTiaoParser;
    @Autowired
    private JiaXingXWParser jiaXingXWParser;
    @Autowired
    private XinLangKanDian xinLangKanDian;
    @Autowired
    private BuCuoReBangParser buCuoReBangParser;
    @Autowired
    private JinRiGuanZhuParser jinRiGuanZhuParser;
    @Autowired
    private FuJianShuChiParser fuJianShuChiParser;
    @Autowired
    private HuaTuZiParser huaTuZiParser;
    @Autowired
    private BeiFangLunTanParser beiFangLunTanParser;
    @Autowired
    private NvRenWangParser nvRenWangParser;




    public Map<Integer, BaseParser> parserMap;
    @PostConstruct
    private void init() {
        parserMap = new HashMap<Integer, BaseParser>() {{
            put(CrawlConstant.SOHU_TAG, sohuParser);
            put(CrawlConstant.LIFE_TIMES_TAG, lifeTimesParser);
            put(CrawlConstant.JIANSHU_TAG, jianshuParser);
            put(CrawlConstant.TOUTIAO_TAG, toutiaoParser);
            put(CrawlConstant.WEIXIN_TAG, weixinParser);
            put(CrawlConstant.WANGYI_TAG, wangyiParser);
            put(CrawlConstant.XINLANG_TAG, xinLangParser);
            put(CrawlConstant.FENGHUANG_TAG, fengHuangParser);
            put(CrawlConstant.TENGXUN_TAG, tengXunParser);
            put(CrawlConstant.XINHUA_TAG, xinHuaParser);
            put(CrawlConstant.YANGSHI_TAG, yangShiParser);
            put(CrawlConstant.HUANQIU_TAG, huanQiuParser);
            put(CrawlConstant.CANKAOXIAOXI_TAG, canKaoXiaoXiParser);
            put(CrawlConstant.RENMIN_TAG, renMinParser);
            put(CrawlConstant.BAIDUBAIJIA_TAG, baiDuBaiJiaParser);
            put(CrawlConstant.ZHONGGUOZHENGFU_TAG, zhongGuoZhengFuParser);
            put(CrawlConstant.DAGONG_TAG, daGongParser);
            put(CrawlConstant.ZHONGGUOQINGNIAN_TAG, zhongGuoQingNianParser);
            put(CrawlConstant.YANGGUANG_TAG, yangGuangParser);
            put(CrawlConstant.GUOJIZAIXIAN_TAG, guoJiZaiXianParser);
            put(CrawlConstant.XINGDAOHUANQIU_TAG, xingDaoHuanQiuParser);
            put(CrawlConstant.DONGFANG_TAG, dongFangParser);
            put(CrawlConstant.ANQINGXINWEN_TAG, anQingXinWenParser);
            put(CrawlConstant.ANHUI_TAG, anHuiParser);
            put(CrawlConstant.ZONGYANGZAIXIAN_TAG, zongYangZaiXianParser);
            put(CrawlConstant.HUAXIASHIBAO_TAG, huaXiaShiBaoParser);
            put(CrawlConstant.QIANLONGXINWEN_TAG, qianLongXinWenParser);
            put(CrawlConstant.XINJINGBAO_TAG, xinJingBaoParser);
            put(CrawlConstant.TIANJINGWANG_TAG, tianJingWangParser);
            put(CrawlConstant.CHONGQINGWANBAO_TAG, chongQingWanBaoParser);
            put(CrawlConstant.DONGNAN_TAG, dongNanParser);
            put(CrawlConstant.MEIZHOUWANG_TAG, meiZhouWangParser);
            put(CrawlConstant.GUANGXIXINWEN_TAG, guangXiXinWenParser);
            put(CrawlConstant.GUIZHOUDUSHIBAO_TAG, guiZhouDuShiBaoParser);
            put(CrawlConstant.QILUWANBAO_TAG, qiLuWanBaoParser);
            put(CrawlConstant.HEBEIQINGNIANBAO_TAG, heBeiQingNianBaoParser);
            put(CrawlConstant.SHIJIAZHUANGXINWEN_TAG, shiJiaZhuangXinWenParser);
            put(CrawlConstant.HANDANXINWEN_TAG, hanDanXinWenParser);
            put(CrawlConstant.HEBEIXINWEN_TAG, heBeiXinWenParser);
            put(CrawlConstant.DONGFANGJINBAO_TAG, dongFangJinBaoParser);
            put(CrawlConstant.ZHUMADIANXINWEN_TAG, zhuMaDianXinWenParser);
            put(CrawlConstant.LUOHEWANG_TAG, luoHeWangParser);
            put(CrawlConstant.DAHEWANG_TAG, daHeWangParser);
            put(CrawlConstant.JIEMIAN_TAG, jieMianParser);
            put(CrawlConstant.DUJIA_TAG, duJiaParser);
            put(CrawlConstant.TAIMEITI_TAG, taiMeiTiParser);
            put(CrawlConstant.KANCHAIWANG_TAG, kanChaiWangParser);
            put(CrawlConstant.KE_TAG, keParser);
            put(CrawlConstant.TOUZIJIE_TAG, touZiJieParser);
            put(CrawlConstant.HUXIU_TAG, huXiuParser);
            put(CrawlConstant.AIRUIWANG_TAG, aiRuiParser);
            put(CrawlConstant.YIXINLI_TAG, yiXinLiParser);
            put(CrawlConstant.TOPYS_TAG, topYSParser);
            put(CrawlConstant.RRDSCPJL_TAG, rrdscpjlParser);
            put(CrawlConstant.ADMIN_TAG, adminParser);
            put(CrawlConstant.GUOKE_TAG, guoKeParser);
            put(CrawlConstant.ZGSHIGE_TAG, zgShiGeParser);
            put(CrawlConstant.SHULAQUAN_TAG, shuLaQuanParser);
            put(CrawlConstant.UEZZB_TAG, ueZongZuoBiaoParser);
            put(CrawlConstant.PINWAN_TAG, pinWanParser);
            put(CrawlConstant.JINRONGJIE_TAG, jinRongJieParser);
            put(CrawlConstant.NANFANGZHOUMO_TAG, nanFangZhouMoParser);
            put(CrawlConstant.MEIJINGWANG_TAG, meiJingWangParser);
            put(CrawlConstant.XLISHI_TAG, xLiShiParser);
            put(CrawlConstant.GQ_TAG, gqParser);
            put(CrawlConstant.HANXING_TAG, hanXingParser);
            put(CrawlConstant.NANDUYULE_TAG, nanDuYuLeParser);
            put(CrawlConstant.ZIMEI_TAG, ziMeiParser);
            put(CrawlConstant.JINGHUASHIBAO_TAG, jingHuaShiBaoParser);
          /*  put(CrawlConstant.WEIKOUWANG_TAG,weiKouWangParser);*/
            put(CrawlConstant.ZGQIYEJIA_TAG, zgQiYeJiaParser);
            put(CrawlConstant.JINYANGFOOD_TAG, jinYangFoodParser);
            put(CrawlConstant.GONGSHI_TAG, gongShiParser);
            put(CrawlConstant.CHUANGYEBANG_TAG, chuangYeBangParser);
            put(CrawlConstant.ZGJINGYING_TAG, zgJingYingParser);
            put(CrawlConstant.SHANGXUEYUAN_TAG, shangXueYuanParser);
            put(CrawlConstant.ZHICHANG_TAG, zhiChangParser);
            put(CrawlConstant.YIBANG_TAG, yiBangParser);
            put(CrawlConstant.TUIKU_TAG, tuiKuParser);
            put(CrawlConstant.YUELVXING_TAG, yueLvXingParser);
            put(CrawlConstant.CHUANSONGMEN_TAG, chuanSongMenParser);
            put(CrawlConstant.TUOPURIBAO_TAG, tuoPuRiBaoParser);
            put(CrawlConstant.SHENGHUOZHI_TAG, shengHuoZhiParser);
            put(CrawlConstant.WENYISHENGHUO_TAG, wenYiShengHuoParser);
            put(CrawlConstant.XINLANGBOKE_TAG, xinLangBoKeParser);
            put(CrawlConstant.ZHONGXIRUAN_TAG, zhongXiRuanParser);
            put(CrawlConstant.ZGHYXXW_TAG, zghyxxwParser);
            put(CrawlConstant.SHANGLUTONG_TAG, shangLuTongParser);
            put(CrawlConstant.SWFWW_TAG, swfwwParser);
            put(CrawlConstant.SOULEWANG_TAG, souLeParser);
            put(CrawlConstant.HFIPLAW_TAG, hfiplawParser);
            put(CrawlConstant.ZHONGHUAQUMINGWANG_TAG, zhongHuaQuMingWangParser);
            put(CrawlConstant.FABANGWANG_TAG, faBangWangParser);
            put(CrawlConstant.SHANGBIAO_TAG, shangBiaoParser);
            put(CrawlConstant.YIZHANYUEDU_TAG, yiZhanYueDuParser);
            put(CrawlConstant.NAJIAOLUO_TAG, naJiaoLuoParser);
            put(CrawlConstant.BEIJINGLIANMENG_TAG, beiJingLianMengParser);
            put(CrawlConstant.KUFAN_TAG, kuFanParser);
            put(CrawlConstant.LUNWENWANG_TAG, lunWenWangParser);
            put(CrawlConstant.GERENTUSHUGUAN_TAG, geRenTuShuGuanParser);
            put(CrawlConstant.NIUBB_TAG, niuBBParser);
            put(CrawlConstant.NIUGEWANG_TAG, niuGeWangParser);
            put(CrawlConstant.TZTT_TAG, tzttParser);
            put(CrawlConstant.QKZZ_TAG, qkzzParser);
            put(CrawlConstant.LIUXINGSHE_TAG, liuXingSheParser);
            put(CrawlConstant.JIANBIHUA_TAG, jianBiHuaParser);
            put(CrawlConstant.YCWB_TAG, ycwbParser);
            put(CrawlConstant.JINYANGKEJI_TAG, jinYangKeJiParser);
            put(CrawlConstant.JINYANGQICHE_TAG, jinYangQiCheParsers);
            put(CrawlConstant.JINYANGJIANKANG_TAG, jinYangJianKangParser);
            put(CrawlConstant.JINYANGLIFE_TAG, jinYangLifeParser);
            put(CrawlConstant.JINYANGCULTURE_TAG, jinYangCutureParser);
            put(CrawlConstant.JINYANGMONEY_TAG, jinYangMoneyParser);
            put(CrawlConstant.JINYANGEDU_TAG, jinYangEduParser);
            put(CrawlConstant.JINYANG_TAG, jinYangParser);
            put(CrawlConstant.ZUOJIA_TAG, zuoJiaParser);
            put(CrawlConstant.AINIWEI_TAG, aiNiWeiParser);
            put(CrawlConstant.YULUWENZHANG_TAG, yuLuWenZhangParser);
            put(CrawlConstant.YUWENMI_TAG, yuWenMiParser);
            put(CrawlConstant.XUE_TAG, xueParser);
            put(CrawlConstant.FENGSHANG_TAG, fengShangParser);
            put(CrawlConstant.KUKUWANG_TAG, kuKuWangParser);
            put(CrawlConstant.SANLIAN_TAG, sanLianParser);
            put(CrawlConstant.QUANQUANWANG_TAG, quanQuanWangParser);
            put(CrawlConstant.JIUAIYUEDU_TAG, jiuAiYueDuParser);
            put(CrawlConstant.JIFENG_TAG, jiFengParser);
            put(CrawlConstant.XUEYOU_TAG, xueYouParser);
            put(CrawlConstant.BAIDUWENKU_TAG, baiDuWenKuParser);
            put(CrawlConstant.SANYIWENKU_TAG, sanYiWenKuParser);
            put(CrawlConstant.SHYLJMJGJSYXGS_TAG, asiaLuoSiParser);
            put(CrawlConstant.DAXUESHENGZAIXIAN_TAG, daXueShengZaiXianParser);
            put(CrawlConstant.KAOSHIBA_TAG, kaoShiBaParser);
            put(CrawlConstant.YANCAOCHINA_TAG, yanCaoChinaParser);
            put(CrawlConstant.KJSON_TAG, kjsonParser);
            put(CrawlConstant.GUIYANG_TAG, guiYangParser);
            put(CrawlConstant.XUZHOUZAIXIAN_TAG, xuZhouZaiXianParser);
            put(CrawlConstant.DAOZHOU_TAG, daoZhouParser);
            put(CrawlConstant.NANYANGSHI_TAG, nanYangShiParser);
            put(CrawlConstant.ZIXUE_TAG, ziXueParser);
            put(CrawlConstant.XUAN6_TAG, xuan6Parser);
            put(CrawlConstant.JIAZHANGBANG_TAG, jiaZhangBangParser);
            put(CrawlConstant.QINQINBAOBEI_TAG, qinQinBaoBeiParser);
            put(CrawlConstant.BEIFANG_TAG, beiFangParser);
            put(CrawlConstant.PAOPAO_TAG, paoPaoParser);
            put(CrawlConstant.DOUBAN_TAG, douBanParser);
            put(CrawlConstant.AIWEIBANG_TAG, aiWeiBangParser);
            put(CrawlConstant.KAODIANER_TAG, kaoDianErParser);
            put(CrawlConstant.DIYIWANGDAI_TAG, diYiWangDaiParser);
            put(CrawlConstant.HEXUN_TAG, heXunParser);
            put(CrawlConstant.RGZNZWZXPT_TAG, rgznzwzxptParser);
            put(CrawlConstant.ZHANZHANGZHIJIA_TAG, zhanzhangzhijia);
            put(CrawlConstant.QINGWANG_TAG, qingWangParser);
            put(CrawlConstant.HUIBOTOUYAN_TAG, huiBoZiXunParser);
            put(CrawlConstant.TIANYA_TAG, tianYaParser);
            put(CrawlConstant.TONGXINSHIJIE_TAG, tongXinShiJieParser);
            put(CrawlConstant.BEIJINGCANKAO_TAG, beiJingCanKaoParser);
            put(CrawlConstant.JIANKANGSHENGHUO_TAG, jianKangShengHuoParser);
            put(CrawlConstant.YUER_TAG, yuErParser);
            put(CrawlConstant.HUHU_TAG, huHuParser);
            put(CrawlConstant.WANHUAJING_TAG, wanHuaJingParser);
            put(CrawlConstant.JINTIANXINWEN_TAG, jinTianXinWenParser);
            put(CrawlConstant.BEIERQIN_TAG, beiErQinParser);
            put(CrawlConstant.TONGLIANGSHICHUANG_TAG, tongLiangShiChuangParser);
            put(CrawlConstant.PINTU_TAG, pinTuParser);
            put(CrawlConstant.ZGDZSWYJZX_TAG, zgdzswyjParers);
            put(CrawlConstant.YUEDU_TAG, yueDuParser);
            put(CrawlConstant.KAIXIN_TAG, kaiXinParser);
            put(CrawlConstant.WEITOUTIAO_TAG, weiTouTiaoParser);
            put(CrawlConstant.HAOKU_TAG, haoKuParser);
            put(CrawlConstant.SANWEN_TAG, sanWenParser);
            put(CrawlConstant.YIDIANZIXUN_TAG, yiDianZiXunParser);
            put(CrawlConstant.FENSI_TAG, fenSiParser);
            put(CrawlConstant.GUOKU_TAG, guoKuParser);
            put(CrawlConstant.HUAZHIRENCAI_TAG, huaZhiRenCaiParser);
            put(CrawlConstant.SHANGYOUQUAN_TAG, shangYouQuanParser);
            put(CrawlConstant.ZGGXXLZX_TAG, zggxxlzxParser);
            put(CrawlConstant.WENKANG_TAG, wenKangParser);
            put(CrawlConstant.HBYUANCHENGJIAOYU_TAG, hbYuanChengParser);
            put(CrawlConstant.YIMIYANGGUANG_TAG, yiMiYangGuangParser);
            put(CrawlConstant.JINGDIANSANWEN_TAG, jingDianSanWenParser);
            put(CrawlConstant.RENSHENGZHINAN_TAG, renShengZhiNanParsers);
            put(CrawlConstant.CN21_TAG, cn21Parser);
            put(CrawlConstant.WEISHIDAI_TAG, weiShiDaiParser);
            put(CrawlConstant.BEIJINGWANBAO_TAG, beiJingWanBaoParser);
            put(CrawlConstant.ZHIBEIJIAOYU_TAG, zhiBeiJiaoYuParser);
            put(CrawlConstant.BIYOU_TAG, biYouParser);
            put(CrawlConstant.LEDU_TAG, leDuParser);
            put(CrawlConstant.ZHONGGUOYULE_TAG, zhongGuoYuLeParser);
            put(CrawlConstant.DAZUIBABA_TAG, daZuiBaBaParser);
            put(CrawlConstant.ZHANGZISHI_TAG, zhangZiShiParser);
            put(CrawlConstant.XINLAN_TAG, xinLanParser);
            put(CrawlConstant.MEITAN_TAG, meiTanParser);
            put(CrawlConstant.GUANGMING_TAG, guangMingParser);
            put(CrawlConstant.AOYI_TAG, aoYiParser);
            put(CrawlConstant.CHANGJIANG_TAG, changJiangParser);
            put(CrawlConstant.LANJING_TAG, lanJingParser);
            put(CrawlConstant.JIASUHUI_TAG, jiaSuHuiParser);
            put(CrawlConstant.PIANKE_TAG, pianKeParser);
            put(CrawlConstant.XINIUGUSHI_TAG, xiNiuGuShiParser);
            put(CrawlConstant.MAFENGWO_TAG, maFengWoParser);
            put(CrawlConstant.CHANGJIANGRIBAO_TAG, changJiangRiBaoParser);
            put(CrawlConstant.ZOL_TAG, zolParser);
            put(CrawlConstant.SANMAO_TAG, sanMaoParser);
            put(CrawlConstant.DOUBANMM_TAG, douBanMMParser);
            put(CrawlConstant.JINGDIAN_TGA,jingDianParser);
            put(CrawlConstant.SHIGUANGWANG_TAG, shiGuangWangParser);
            put(CrawlConstant.KAIDISHEQU_TGA, kaiDiSheQuParser);
            put(CrawlConstant.BOAOREVIEW_TAG,boAoParser);
            put(CrawlConstant.JINJIANGNEWS_TAG,jinjiangParser);
            put(CrawlConstant.QIANJIANGWANBAO_TAG,qianJiangParser);
            put(CrawlConstant.ZHIHU_TAG,zhihuParser);
            put(CrawlConstant.FUWUHUI_TAG,fuWuHuiParser);
            put(CrawlConstant.PENGPAI_TAG, pengPaiParser);
            put(CrawlConstant.XUEQIU_TAG,xueQiuParser);
            put(CrawlConstant.WACAI_TAG,waCaiParser);
            put(CrawlConstant.LIEYUN_TAG,lieYunParser);
            put(CrawlConstant.SOUGOUWEIXIN_TAG,souGouWeiXinParser);
            put(CrawlConstant.TUONIAO_TAG,tuoNiaoParser);
            put(CrawlConstant.KUAIBAO_TAG,kuaiBaoParser);
            put(CrawlConstant.ZHEJIANGRIBAO_TAG, zheJiangRiBaoParser);
            put(CrawlConstant.GONGCHANDANGYUAN_TAG, gongChanDangYuanParser);
            put(CrawlConstant.ZHEJIANGFAZHI_TAG, zheJiangFaZhiBaoParser);
            put(CrawlConstant.JIANGNANYOUBAO_TAG, jiangNanYouBaoParser);
            put(CrawlConstant.HAININGRIBAO_TAG, haiNingRiBaoParser);
            put(CrawlConstant.DONGYANGRIBAO_TAG, dongYangRiBaoParser);
            put(CrawlConstant.MEISHUBAO_TAG, meiShuBaoParser);
            put(CrawlConstant.WENLINGRIBAO_TAG,wenLingRiBaoParser);
            put(CrawlConstant.ZHEJIANGLAONIANBAO_TAG, zheJiangLaoNianBaoParser);
            put(CrawlConstant.KEQIAORIBAO_TAG, keQiaoRiBaoParser);
            put(CrawlConstant.CHUANGZHI_TAG, chuangZhiParser);
            put(CrawlConstant.QUANJIHANGMU_TAG, quanJiHangMuParser);
            put(CrawlConstant.JIKEGONGYUAN_TAG, jiKeGongYuanParser);
            put(CrawlConstant.BOWANGZHI_TAG, boWangZhiParser);
            put(CrawlConstant.QIANBAO_TAG, qianBaoParser);
            put(CrawlConstant.QIANBIDAO_TAG, pencilNewsParser);
            put(CrawlConstant.ZHEJIANG24HOUR_TAG, zheJiang24HourParser);
            put(CrawlConstant.BAIJIAHAO_TAG, baiJiaHaoParser);
            put(CrawlConstant.JIANKANGSHIBAO_TAG, jianKangShiBaoParser);
            put(CrawlConstant.TEMAI_TAG, teMaiParser);
            put(CrawlConstant.WAITAN_TAG, waiTanParser);
            put(CrawlConstant.KUAIWANSIWEI_TAG, kuaiWanSiWeiParser);
            put(CrawlConstant.LUOYANGXINWEN_TAG, luoYangParser);
            put(CrawlConstant.UCTOUTIAO_TAG, ucTouTiaoParser);
            put(CrawlConstant.SSPAI_TAG, ssPaiParser);
            put(CrawlConstant.CHAOQI_TAG, chaoQiParser);
            put(CrawlConstant.BEIJINGSHIJIAN_TAG, beiJingShiJianParser);
            put(CrawlConstant.UCTOUTIAOMOBILE_TAG, ucTouTiaoMobileParser);
            put(CrawlConstant.LEJU_TAG, leJuParser);
            put(CrawlConstant.ZHIYIN_TAG, zhiYinParser);
            put(CrawlConstant.AIFANER_TAG, aiFanErParser);
            put(CrawlConstant.YOUDIAO_TAG, youDiaoParser);
            put(CrawlConstant.BAIJIAHAO2_TAG, baiJiaHao2Parser);
            put(CrawlConstant.HINABIAN_TAG, hiNaBianParser);
            put(CrawlConstant.TOUZISHEQU_TAG, touZiSheQuParser);
            put(CrawlConstant.KUAIZIXUN_TAG, kuaiZiXunParse);
            put(CrawlConstant.JINRIXINXIANSHI_TAG,jinRiXinXianShiPaser);
            put(CrawlConstant.DANDANZAN_TAG,danDanZanParser);
            put(CrawlConstant.PINLUEWANG_TAG,pinLueWangParser);
            put(CrawlConstant.YULEZIXUNWANG_TAG,yuLeZiXunWangParser);
            put(CrawlConstant.ZHENGEXUEWANG_TAG,zhenGeXueWangParser);
            put(CrawlConstant.QIHU_TAG,qiHuParser);
            put(CrawlConstant.HUAQI_TAG,huaQiWangParser);
            put(CrawlConstant.SHAOYANGFC_TAG,shaoYangFCParser);
            put(CrawlConstant.ZHUQIUZHIBO_TAG,zhuQiuZhiBoParser);
            put(CrawlConstant.BAIJIAZAPING_TAG,baiJiaZaPingParser);
            put(CrawlConstant.TSZLAOWU_TAG,tszLaoWuParser);
            put(CrawlConstant.TIANCHENGYILIAO_TAG,tianChengYiLiaoParser);
            put(CrawlConstant.BITCOIN_TAG,bitCoinParser);
            put(CrawlConstant.TIANKONGTALK_TAG,tianKongTalkParser);
            put(CrawlConstant.ZHONGYUAN_TAG,zhongYuanParser);
            put(CrawlConstant.BANBAN_TAG,banBanParser);
            put(CrawlConstant.LATIAOZIXUN_TAG,laTiaoZiXunParser);
            put(CrawlConstant.JIANKANGTOUTIAO_TAG,jianKangTouTiaoParser);
            put(CrawlConstant.JIAXINGXW_TAG,jiaXingXWParser);
            put(CrawlConstant.XINLANGKANDIAN_TAG,xinLangKanDian);
            put(CrawlConstant.BUCUOREBANG_TAG,buCuoReBangParser);
            put(CrawlConstant.JINRIGUANZHU_TAG,jinRiGuanZhuParser);
            put(CrawlConstant.FUJIANSHUCHI_TAG,fuJianShuChiParser);
            put(CrawlConstant.HUATUZI_TAG,huaTuZiParser);
            put(CrawlConstant.BEIFANGLUNTAN_TAG,beiFangLunTanParser);
            put(CrawlConstant.NVRENWANG_TAG,nvRenWangParser);
        }};
        crawlerMap = new HashMap<Integer, BaseCrawler>() {{
            put(CrawlConstant.SOHU_TAG, sohuCrawler);
            put(CrawlConstant.JIANSHU_TAG, jianshuCrawler);
            put(CrawlConstant.TOUTIAO_TAG, toutiaoCrawler);
            put(CrawlConstant.BAIDUBAIJIA_TAG, baijiaCrawler);
            put(CrawlConstant.XINIUGUSHI_TAG, xiNiuGuShiCrawler);
            put(CrawlConstant.XINLANGBOKE_TAG, xinLangBoKeCrawler);
            put(CrawlConstant.DOUBANCOMMENT_TAG, douBanCommentCrawler);
            put(CrawlConstant.DOUBANNOTE_TAG, douBanNoteCrawler);
            put(CrawlConstant.SHIGUANGWANG_TAG, shiGuangWangCrawler);
            put(CrawlConstant.ZHIHU_TAG, zhiHuCrawler);
            put(CrawlConstant.CHUANSONGMEN_TAG,chuanSongMenCrawler);
            put(CrawlConstant.FUWUHUI_TAG,fuWuHuiCrawler);
            put(CrawlConstant.KUAIBAO_TAG,kuaiBaoCrawler);
            put(CrawlConstant.PINTU_TAG,pinTuCrawler);
            put(CrawlConstant.CHUANGZHI_TAG,chuangZhiCrawler);
            put(CrawlConstant.QUANJIHANGMU_TAG,quanJiHangMuCrawler);
            put(CrawlConstant.JIKEGONGYUAN_TAG,jiKeGongYuanCrawler);
            put(CrawlConstant.BOWANGZHI_TAG,boWangZhiCrawler);
            put(CrawlConstant.QIANBAO_TAG,qianBaoCrawler);
            put(CrawlConstant.QIANBIDAO_TAG,qianBiDaoCrawler);
            put(CrawlConstant.ZHEJIANG24HOUR_TAG,zheJiang24HourCrawler);
            put(CrawlConstant.BAIJIAHAO_TAG,baiJiaHaoCrawler);
            put(CrawlConstant.TOUZISHEQU_TAG,touZiSheQuCrawler);


        }};
    }

    /**
     * 更新作者文章
     *
     * @param authorLink 作者文章链接
     * @return JsonResult
     */
    public JsonResult run(AuthorLink authorLink) {
        if (authorLink == null) {
            return error("作者链接记录为空");
        }
        String link = authorLink.getLink();
        if (StringUtils.isBlank(link)) {
            return error("作者文章链接为空");
        }
        JsonResult result = new JsonResult();
        switch (authorLink.getTag()) {
            case CrawlConstant.TOUTIAO_TAG:
                result = toutiaoCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
            case CrawlConstant.SOHU_TAG:
                result = sohuCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
            case CrawlConstant.JIANSHU_TAG:
                result = jianshuCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
            case CrawlConstant.BAIDUBAIJIA_TAG:
                result = baijiaCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
            case CrawlConstant.XINLANGBOKE_TAG:
                result = xinLangBoKeCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
            case CrawlConstant.XINIUGUSHI_TAG:
                result = xiNiuGuShiCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
            case CrawlConstant.BAIJIAHAO_TAG:
                result = baiJiaHaoCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
          /*  case CrawlConstant.KUAIBAO_TAG:
                result = kuaiBaoCrawler.startAuto(authorLink.getAuthorId(), link);
                break;*/
            case CrawlConstant.DOUBANNOTE_TAG:
                result = douBanNoteCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
            case CrawlConstant.DOUBANCOMMENT_TAG:
                result = douBanCommentCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
            case CrawlConstant.PINTU_TAG:
                result = pinTuCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
            case CrawlConstant.ZHIHU_TAG:
                result = zhiHuCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
            case CrawlConstant.ZHEJIANG24HOUR_TAG:
                result = zheJiang24HourCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
            case CrawlConstant.JIKEGONGYUAN_TAG:
                result = jiKeGongYuanCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
            case CrawlConstant.QUANJIHANGMU_TAG:
                result = quanJiHangMuCrawler.startAuto(authorLink.getAuthorId(), link);
                break;
        }
        if (result.isSuccess()) {
            logger.info("success:" + result.getInt());
            if (authorLink.getValid() != AuthorLink.VALID_YES) {
                articleCrawlMapper.setLinkValid(link);
            }
        } else {
            logger.error(result.getMsg());
        }
        // 设置链接最后更新时间
        articleCrawlMapper.updateLinkLastTime(link);
        return result;
    }

    /**
     * @param size 数量
     * @return 根据 平台名称是否为空查询文章
     */
    public List<Article> queryAArticleByPT(int size) {
        return articleCrawlMapper.queryAArticleByPT(size);
    }

    /**
     * @param size 数量
     * @return 根据 时间查询文章
     */
    public List<Article> queryForPostTime(int size) {
        return articleCrawlMapper.queryForPostTime(size);
    }

    public List<Article> queryListByPTACT() {
        return articleCrawlMapper.queryListByPTACT();
    }

    public void updatePlatForm(Article article, String link, int tag, BaseParser baseParser) {
        if (StringUtils.isBlank(link)) {
            article.setPlatform("快版权");
        } else {
            if (tag == -1) {
                article.setPlatform("未知");
            } else {
                article.setPlatform(baseParser.getPlatForm());
            }
        }
        articleCrawlMapper.updatePlatForm(article);
    }

    public void updatePostTime(Article article, BaseParser baseParser) {
        Date postTimeOld = article.getPostTime();
        if (baseParser == null) {
            article.setPostTime(DateUtil.oneSecondBefore(postTimeOld));
        } else {
            baseParser.setPostDate(article);
            if (postTimeOld.equals(article.getPostTime())) {
                article.setPostTime(DateUtil.oneSecondBefore(postTimeOld));
            }
        }
        articleCrawlMapper.updatePostTime(article);
    }

    public boolean check(Article article, BaseParser baseParser) {
        String oldTitle = article.getTitle();
        String oldBody = article.getBody();
        String oldDate = DateUtil.formatTime(article.getPostTime());
        String oldAuthorName = article.getAuthorName();
        String oldCoverPath = article.getCoverPath();
        String newAuthorName = article.getAuthorName();
        String platform = article.getPlatform();
        Author author = articleCrawlMapper.queryAuthor(article.getAuthorId());
        Document doc = baseParser.getDocument(article.getLink());
        //如果现在解析不到了，说明该文章已经被删除了，人为去检查一下
        if (doc == null) {
            return false;
        }
        // 解析发布日期、内容、封面等
        baseParser.parse(doc, article, true);
        if (StringUtils.isBlank(article.getAuthorName())) {
            newAuthorName = author.getAuthorName();
        }
        // 发布日期
        String time = DateUtil.formatTime(article.getPostTime());
        if (checkElement(oldTitle, article.getTitle(), platform + "标题问题") && checkElement(oldBody, article.getBody(), platform + "内容问题") &&
                checkElement(oldDate, time, platform + "时间问题") && checkElement(oldAuthorName, newAuthorName, platform + "作者名称问题") &&
                checkElement(oldCoverPath, article.getCoverPath(), platform + "图片链接问题")) {
            return true;
        }
        return false;
    }

    boolean checkElement(String oldData, String newData, String platform) {
        Boolean success = true;
        if (StringUtils.isBlank(oldData) && StringUtils.isBlank(newData)) {
            logger.info(platform);
            return true;
        }
        if (StringUtils.isBlank(oldData) && StringUtils.isNotBlank(newData)) {
            logger.info(platform);
            return false;
        }
        if (StringUtils.isNotBlank(oldData) && !oldData.equals(newData)) {
            logger.info(platform);
            return false;
        }
        return success;
    }

}
